package org.example.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.sql.ResultSet;
import java.sql.SQLException;

@AllArgsConstructor
@Data
@ToString
@NoArgsConstructor
public class User {
    private int userId;
    private String userName;
    private String userPassword;
    private String phone;

    public static User map(ResultSet rs) throws SQLException {
        return new User(
                rs.getInt("user_id"),
                rs.getString("user_name"),
                rs.getString("user_password"),
                rs.getString("phone")
        );
    }
}
